home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MACD 5
/
MACD 5.bin
/
workbench
/
tools
/
czesc_2
/
interfaces
/
willy-ttx
/
quicksort-source
/
qsorttest.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1992-09-28
|
912b
|
36 lines
/** QsortTest.rexx
*
* This is a test of QSORT
*
**/
arg names
if names = "" then names = "*"
/*
* FileList is a rexxarplib function.
* It returns a stem variable who's elements (files.1, files.2 ...)
* contain file names. files.0 contains the number of files found.
*/
result = FileList(names, files, , E)
say "We have the list of files. Sorting"
do i = 1 to files.0; say files.i; end
call ListRequest(1, files.0, files, selected, 0, 0, 400, 150, "VLT", SORT)
say "We selected: " selected
/*
* QSORT is the QuickSort function
*
* Calling sequence:
*
* QSORT(first, last, array)
* first = number of first element to be sorted
* last = number of last element to be sorted
* array = stem variable array who's elements need to be sorted.
*
*/
call QSORT(1, files.0, files)
/*
* Print the result
*/
say ""
say "Same list, but sorted"
do i = 1 to files.0; say files.i; end